package org.liaohailong.helloworld.fragment

import android.animation.Animator
import android.content.Context
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import androidx.fragment.app.Fragment
import org.liaohailong.helloworld.R

/**
 * Describe:
 *
 *
 * @author liaohailong
 * Time: 2021/6/18 17:14
 */
class MainFragment : Fragment() {

    private fun log(msg: String) {
        Log.i("MainFragment", msg)
    }

    override fun onAttachFragment(childFragment: Fragment) {
        log("onAttachFragment")
        super.onAttachFragment(childFragment)
    }

    override fun onAttach(context: Context) {
        log("onAttach")
        super.onAttach(context)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        log("onCreate savedInstanceState = $savedInstanceState")
        super.onCreate(savedInstanceState)
    }

    override fun onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int): Animator? {
        log("onCreateAnimator")
        return super.onCreateAnimator(transit, enter, nextAnim)
    }

    override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
        log("onCreateAnimation")
        return super.onCreateAnimation(transit, enter, nextAnim)
    }

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        log("onCreateView savedInstanceState = $savedInstanceState")
        return inflater.inflate(R.layout.fragment_main, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        log("onViewCreated savedInstanceState = $savedInstanceState")
        super.onViewCreated(view, savedInstanceState)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        log("onActivityCreated savedInstanceState = $savedInstanceState")
        super.onActivityCreated(savedInstanceState)
    }

    override fun onStart() {
        log("onStart")
        super.onStart()
    }

    override fun onResume() {
        log("onResume")
        super.onResume()
    }

    override fun onPause() {
        log("onPause")
        super.onPause()
    }

    override fun onSaveInstanceState(outState: Bundle) {
        log("onSaveInstanceState = $outState")
        super.onSaveInstanceState(outState)
    }

    override fun onStop() {
        log("onStop")
        super.onStop()
    }

    override fun onDestroyView() {
        log("onDestroyView")
        super.onDestroyView()
    }

    override fun onDestroy() {
        log("onDestroy")
        super.onDestroy()
    }

    override fun onDetach() {
        log("onDetach")
        super.onDetach()
    }
}